/**
 * @AbstractCommonBean.java  COPYRIGHT xiaojian
 * 
 * Created on 2016年7月18日 下午2:38:22
 */
package xiaojian.toolkit.bean;

import xiaojian.toolkit.util.DefaultPropertiesSupport;
import xiaojian.toolkit.util.Identifier;
import xiaojian.toolkit.util.MutableIdentifyable;

/**
 * @author <a href="mailto:cxj2000@gmail.com">xiaojian.cao</a>
 *
 */
public class AbstractCommonBean<T> extends DefaultPropertiesSupport implements MutableIdentifyable<T> {

	private static final long serialVersionUID = -275612902695195588L;
	
	private Identifier<T> identifier = null;


	/**
	 * @see java.lang.Object#equals(java.lang.Object)
	 */
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (!super.equals(obj))
			return false;
		if (getClass() != obj.getClass())
			return false;
		@SuppressWarnings("unchecked")
		AbstractCommonBean<T> other = (AbstractCommonBean<T>) obj;
		if (identifier == null) {
			if (other.identifier != null)
				return false;
		} else if (!identifier.equals(other.identifier))
			return false;
		return true;
	}


	public Identifier<T> getIdentification() {
		return identifier;
	}


	public void setIdentification(Identifier<T> id) {
		this.identifier = id;
	}


}
